import request from '@/utils/request'

// 新增服务项目
export const addProjectService = (projectAddDTO) => {
  return request.post('/admin/project/add', projectAddDTO)
}

// 服务项目分页查询
export const projectPageQueryService = (projectPageQueryDTO) => {
  return request.get('/admin/project/page', { params: projectPageQueryDTO })
}

// 启用/禁用服务项目状态
export const updateProjectStatusService = (status, id) => {
  return request.post(`/admin/project/status/${status}`, null, { params: { id } })
}

// 根据服务项目id查询服务项目信息
export const getProjectByIdService = (id) => {
  return request.get(`/admin/project/${id}`)
}

// 修改服务项目信息
export const updateProjectService = (projectUpdateDTO) => {
  return request.put('/admin/project', projectUpdateDTO)
}

// 删除服务项目
export const deleteProjectService = (id) => {
  return request.delete(`/admin/project/${id}`)
}

// 新增服务项目类型
export const addProjectTypeService = (projectTypeName) => {
  return request.post('/admin/project/type/add', null, { params: { projectTypeName } })
}

// 服务项目类型分页查询
export const projectTypePageQueryService = (projectTypePageQueryDTO) => {
  return request.get('/admin/project/type/page', { params: projectTypePageQueryDTO })
}

// 启用/禁用服务项目类型状态
export const updateProjectTypeStatusService = (status, id) => {
  return request.post(`/admin/project/type/status/${status}`, null, { params: { id } })
}

// 根据服务项目类型id查询服务项目类型信息
export const getProjectTypeByIdService = (id) => {
  return request.get(`/admin/project/type/${id}`)
}

// 修改服务项目类型信息
export const updateProjectTypeService = (projectTypeUpdateDTO) => {
  return request.put('/admin/project/type', projectTypeUpdateDTO)
}

// 删除服务项目类型
export const deleteProjectTypeService = (id) => {
  return request.delete(`/admin/project/type/${id}`)
}

// 查询所有启用的服务项目类型
export const listProjectTypeService = () => {
  return request.get('/admin/project/type/list')
}
